Skip to content

layoutsNodesChange() fix with neg values#3201

Merged
adumesny merged 1 commit intogridstack:masterfrom
adumesny:master
Dec 12, 2025
Merged

layoutsNodesChange() fix with neg values#3201
adumesny merged 1 commit intogridstack:masterfrom
adumesny:master

Conversation

@adumesny
Copy link
Member

@adumesny adumesny commented Dec 12, 2025

Description

  • updating higher column layout can cause negative values in layoutsNodesChange()

Steps:

  1. load into 3 column, size down to 2 column

  2. move item 1 to the right

  3. size item 0 to 1 column -> makes item 1 move to top causing layout[3] to have negative values y=-1 and apparently not fixed later when going back to 3 column (TBD)

    let grid = GridStack.init({
    cellHeight: 80,
    columnOpts: {
    layout: "compact",
    breakpoints: [{w:700, c:2},{w:850, c:3}]
    },
    children: [{x: 0, y: 0, w:2, content: '0'}, {x: 2, y: 0, content: '1'}]})

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

* updating higher column layout can cause negative values in `layoutsNodesChange()`
@adumesny adumesny merged commit 52ceb49 into gridstack:master Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant